<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>请求参数</title>
    <style type="text/css">
        a {
            margin-left: 25px;
        }
    </style>
</head>

<body>

    <h3>点击超链接传递参数</h3>

    <a href="/">不携带任何参数</a>

    <a href="/?name=张三丰&gender=靓仔&age=108">通过URL携带参数</a>

    <a href="/张三丰/靓仔?age=108">通过路由路径携带参数</a>

    <h3>以GET方式提交参数</h3>

    <form action="/" method="get">
        <input type="text" name="name" placeholder="请输入姓名">
        <input type="radio" name="gender" value="male">靓仔
        <input type="radio" name="gender" value="female">靓妹
        <input type="text" name="age" value="108">
        <input type="submit" value="提交">
    </form>

    <h3>以POST方式提交参数</h3>
    <!-- 对于POST方式提交的表单来说，
         默认采用 application/x-www-form-urlencoded 来编码表单中的各个部分 -->
    <form action="/" method="post" enctype="application/x-www-form-urlencoded">
        <input type="text" name="name" placeholder="请输入姓名">
        <input type="radio" name="gender" value="male">靓仔
        <input type="radio" name="gender" value="female">靓妹
        <input type="text" name="age" value="108">
        <input type="submit" value="提交">
    </form>

    <h3>以POST方式提交参数(text/plain) 【自行测试】</h3>
    <!-- text/plain ：纯文本-->
    <form action="/" method="post" enctype="text/plain">
        <input type="text" name="name" placeholder="请输入姓名">
        <input type="radio" name="gender" value="male">靓仔
        <input type="radio" name="gender" value="female">靓妹
        <input type="text" name="age" value="108">
        <input type="submit" value="提交">
    </form>

</body>

</html>